<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="css/css.css">
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <div class="film-source">
            <span class="star-img" v-for="c in 5" :class="source | starClass(c)"></span>
            <span class="star-source">{{source}}</span>
        </div>
        <hr>

        <div class="film-source" v-for="service in services">
            <span>{{service.title}}</span>
            <span class="star-img" v-for="c in 5" :class="service.source | starClass(c)"></span>
            <span class="star-source">{{service.source}}</span>
        </div>
    </div>
</body>
<script>
    new Vue({
        el:'#app',
        data:{
            source:3.6,
            services:[
                {
                    title:'快递包装',
                    source:3.6
                },
                {
                    title:'送货速度',
                    source:4.3
                },
                {
                    title:'服务态度',
                    source:2.7
                },
            ]
        },
        filters:{
            starClass(target,c){
                return Math.ceil(target)>=c?'open':'close';
            }
        }
    });
</script>
</html>